-
-
Notifications
You must be signed in to change notification settings - Fork 229
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add baking script for archival bakes #4502
Conversation
Quick links (staging server):
Login:
SVG tester:Number of differences (default views): 0 ✅ Edited: 2025-02-11 11:16:52 UTC |
4ffb030
to
8ce7d67
Compare
884f154
to
ccb9ac1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work! Couple of notes:
- Loading the whole file into memory before hashing might consume a lot of memory when we start doing full archival bakes. I guess it's fine to solve this (by switching to streams) once we hit the problem in practice, so this is more of an FYI to keep it in mind.
- Since the asset map is never gonna change, we can save ourselves quite a bit of trouble by attaching it to
window
and reading it from there every time we need to check it, instead of passing it via props. At least for the runtime map, might not be true for the static. Or am I missing something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably want errors from this script reported in Sentry. See e.g. baker/algolia/indexChartsToAlgolia.ts
for an example on how to do it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unresolving, since I don't see the import of serverUtils/instrument.js
at the top. You can copy what's in indexChartsToAlgolia.ts
.
63cb3fb
to
141d073
Compare
Yep, you're absolutely right. I considered doing this, and then didn't end up doing it, but for no good reason really. I've now changed things around and am putting these under |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! LGTM except the missing instrumentation import.
Suspect IssuesThis pull request was deployed and Sentry observed the following issues:
Did you find this useful? React with a 👍 or 👎 |
This implements milestone 1 of #4434: correctly referencing assets in an archival bake.
It:
dods.json
filesstaticAssetMap
andruntimeAssetMap
, respectivelyTo run this locally, run the following:
You can then navigate to http://localhost:3000/latest/grapher/life-expectancy to view the page.